﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BQQAPIClient.Core;
using BQQAPIClient.Core.Business;
using System.Text;

namespace BQQAPIClient.TestSite
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
        }

        protected void AutoAssign_Click(object sender, EventArgs e)
        {
            BQQAPI.AssignKefuFunc = qq => ushort.Parse(AutoAssignKefuID.Text);
        }

        protected void SetKefuStatus_Click(object sender, EventArgs e)
        {
            BQQAPI.SetKefuStatus(new KefuStatus()
            {
                IsHostBySystem = SetKefuStatusSystemHost.Checked ? (byte)1 : (byte)0,
                MaxAutoAssignCount = ushort.Parse(SetKefuStatusMaxAutoAssign.Text),
                KefuID = ushort.Parse(SetKefuStatusKefuID.Text),
                KefuStatusEnum = (KefuStatusEnum)Enum.Parse(typeof(KefuStatusEnum), SetKefuStatusStatusEnum.SelectedValue),
            });
        }

        protected void GetAllKefuStatus_Click(object sender, EventArgs e)
        {
            BQQAPI.GetAllKefuStatus();
        }
    }
}